package com.scalar.chiptrack.commons.bean;

import com.scalar.chiptrack.commons.forms.ResultFormBean;
import com.scalar.chiptrack.db.DBTransaction;

import java.io.Serializable;

/**
 * User: Ganesh
 * Date: Apr 29, 2008
 * Time: 11:20:22 AM
 */
public interface IPaginator extends Serializable {
    /**
     * Returns result page given form bean criteria
     * @return ISearchResultBean
     */
    public IResultBean getPage(ResultFormBean searchFormBean)throws Exception;

    /**
     * Returns search result bean for a given page with the results
     * @param pageNumber int
     * @return ISearchResultBean
     */
    public IResultBean getPage(int pageNumber)throws Exception;

    /**
     * Get total number of pages in the search paginator depending on
     * pagination size
     * @return noOfPages int
     */
    public int getNumberOfPages();

    /**
     * Get total number of records in the search result depending
     * @return int
     */
    public int getNumberOfRecords();

    /**
      * gets the starting index of current page result
    */
    public int getStartIndex();
    /**
     * gets the last index of the current page
     * */
    public int getLastIndex();
    /**
     * Returns Search Result Bean for all search
     * @return ISearchResultBean
     */
    public IResultBean getResults(DBTransaction dbTransaction)throws Exception;

   /* public void closingConnections();*/
}
